home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 4 / ETO Development Tools 4.iso / Tools - Objects / Virtual User 1.0 / Example Scripts / MessagePassing Example / Actor2.vu < prev    next >
Text File  |  1991-01-25  |  2KB  |  52 lines

  1. #
  2. #    File:        actor2.vu
  3. #
  4. #    Contains:    This is a demo script which runs in parallel with the script
  5. #                Actor2.vu. They together demonstrate message passing while 
  6. #                sharing tasks in a library. To run this demo you need two 
  7. #                target machines (both having the Desk Accessory, Key Caps).
  8. #                It would be better if the two targets had different memory
  9. #                configurations and are running different versions of system software.
  10. #                Your command line should be as follows: (assuming the two 
  11. #                targets have user names as Target1 and Target2 and that
  12. #                Actor1.vu, Actor2.vu and the library MessagePassingDemoLib.vu
  13. #                are all in your current working directory)
  14. #                VU    -t1 '*:Target1' -s1 Actor1.vu -l1 Actor1.log ∂
  15. #                    -t2 '*:Target2' -s2 Actor2.vu -l2 Actor2.log
  16. #
  17. #    Caution:    Do not forget to turn the key repeat off in the control panel on both
  18. #                the targets. The script takes a few seconds before you start seeing
  19. #                anything on the target screens.
  20. #
  21. #    Written by:    P Nagarajan
  22. #
  23. #    Copyright:    © 1990 by Apple Computer, Inc., all rights reserved.
  24. #
  25. #    Change History:
  26. #
  27. #        8/16/90       naga         creation 
  28. #
  29. #    To Do:
  30. #
  31.  
  32. Libraries    "MessagePassingDemoLib.vu";
  33.  
  34. actorName((match[target]).t); #change actor's name to target's User Name
  35. main_actor := [actor t:'Actor1'];
  36. open_session(main_actor);
  37. msg := receive(main_actor);
  38. while msg = ''
  39. begin
  40.     wait(1);#wait is used to avoid tight loops
  41.             #in order to share time with other actors
  42.     msg := receive(main_actor);
  43. end;
  44.  
  45. if (msg = 'Start')
  46. begin
  47.     run_demo(main_actor); 
  48. end;#do demo
  49.  
  50. closeSession(main_actor);
  51.  
  52.